<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{lang u_forgot_password} - {lang g_webname}</title>
    <link href="{TPL}css/forgotPassword.css" rel="stylesheet"   type="text/css" />
    <link type="text/css" rel="stylesheet" href="{TPL}css/NewTopFoot.css"  />
    <script src="{TPL}js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="{TPL}js/Gobal.js" type="text/javascript"></script>
    <script type="text/javascript" src="{TPL}js/forgot_one.js"></script>
	<script>
				
		function getverifycode() {
			var phonenum = $.trim($("#phone").val());
			$.ajax({
				type: "POST",
				url: "/ajax/user_ajax.php?action=getverifycode&phone=" + phonenum,
				dataType: "json",
				contentType: "application/json;utf-8",
				data: "{'phone':'" + phonenum + "'}",
				timeout: 5000,
				error: function(a, b, c) { checkcodechecked = true; },
				success: function(msg) {
					if (msg=="OK") {
						
					}
					else {
						alert(msg);
					}
				}
			});
				
		}
		
		
	function phoneblur(dom) {
		var phone = $(dom).val();
		if ($.trim(phone).length <= 0) { $(dom).attr("class", "").val("").next("p").attr("class", ""); }
		else {
        var reg = new RegExp("^6\\d{10}");
        if (reg.test($(dom).val())) {
			$.ajax({
                type: "POST",
                url: "/ajax/user_ajax.php?action=checkphoneown",
                dataType: "json",
                contentType: "application/json;utf-8",
                data: "{'phone':'" + phone + "'}",
                timeout: 10000,
                error: function(a, b, c) {  $(dom).attr("class", "").next("p").attr("class", ""); },
                success: function(msg) {
					//alert(msg);
					if(msg=="OK")
					{
						$(dom).attr("class", "").next("p").attr("class", "").text("");
						$("#getcode").attr("style","margin-left:10px;height:30px;width:90px;float:left;display:block");
					}
					else
					{
						$(dom).attr("class", "wrong").next("p").attr("class", "red").text(msg);
						$("#getcode").attr("style","margin-left:10px;height:30px;width:90px;float:left;display:none");
					}
                }
            });
        }
        else {
            $(dom).attr("class", "wrong").next("p").attr("class", "red").text("{lang u_service_contact_instr1}");
			$("#getcode").attr("style","margin-left:10px;height:30px;width:90px;float:left;display:none");
        }
    }
}
	</script>
	<script type="text/javascript"> 
var timer = null;
var i = 60;
function aa(){
	$('#getcode').removeAttr('disabled').css('cursor','pointer');
}
function bb(){
	$('#getcode').html('稍等'+i+'秒');
	i--;
	if(i<0){
		$('#getcode').html('{lang u_receive_code}');
		clearInterval(timer);
		i=5;
	}
}
$(function(){
	$('#getcode').click(function(){
	$(this).attr('disabled','disabled').css('cursor','default');
	bb();
	clearInterval(timer);
	timer=setInterval('bb()',1000);
	setTimeout("aa()",1000*60);
})
})
</script> 
</head>

<body>
    <form name="resetp" method="post" action="{url_user.php?action=resetp}" id="resetp">
<input type="hidden" name="commit" value="1"/>
	
{template 'header'}
    <div class="center">
        
        <div class="xiugai">
            <table style="margin-top:30px">
                <!--<tr>
                    <td class="z">

                        {lang m_username_r}
                    </td>
                    <td>
                        <input name="username" id="username" value="" type="text" onfocus="this.className='on';$('#nameTip').hide();"
                            onblur="this.className='';" />
                        <p id="nameTip" class="red" style="display: none;">
                            {lang js_user_empty}</p>
                    </td>
                </tr>-->
                <tr>

                    <td class="z">
                        {lang u_phone}：
                    </td>
                    <td>
                        <input id="phone" name="phone" value=""  onblur="phoneblur(this)" 
                            type="text" placeholder="60127798800"/>
                        <p></p>
					  
					  <button type="button" id="getcode" onclick="getverifycode()" name=""
                                            style="margin-left:10px;height:30px;width:90px;float:left;display:none">{lang u_receive_code} </button>
                    </td>
                </tr>

                
                <tr>
                    <td class="z">
                        {lang u_code}：
                    </td>
                    <td>
                        <input name="forgotCode" id="forgotCode" type="text" />
                        
                    </td>

                </tr>
                <tr>
                    <td class="z">
                        {lang u_set_pwd}：
                    </td>
                    <td>
                        <input name="newpass" id="newpass" type="password" />
                        
                    </td>

                </tr>
				<tr>
                    <td class="z">
                        {lang u_confirm}{lang u_set_pwd}：
                    </td>
                    <td>
                        <input name="renewpass" id="renewpass" type="password" />
                        
                    </td>

                </tr>
            </table>
            <div class="tijiao">
                <input class="button" name="" type="button" id="getcode" onclick="resetp.submit()" value="{lang js_pwd_reset}" onmouseover="this.className='button_'"
                    onmouseout="this.className='button'" />
            </div>
        </div>
        <div class="wenxin">
            <a href="{url_user.php?action=register}">{lang m_new_account}</a>
        </div>

        <div class="yj">
        </div>
    </div>
    
{template 'footer'}
    </form>
</body>
</html>
